<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<title>学生列表</title>
<c:import url="/WEB-INF/jsp/head.jsp" />
<link rel="stylesheet"
	href="static/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript"
	src="static/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="static/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript" src="static/js/student/list.js"></script>
<style type="text/css">
.form-inline .form-group {
	margin-bottom: 15px !important;
}
</style>
</head>
<body>
	<div class="default-theme container-fluid iframe">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">搜索条件</div>
				<div class="panel-body">
					<form class="form-inline" action="student/list" method="post">
						<div class="form-group">
							<label for="id">学号:</label> <input type="text"
								class="form-control" name="id" value="${studentId }" />
						</div>
						<div class="form-group">
							<label for="name">学生名称:</label> <input type="text"
								class="form-control" name="name" value="${nameValue }" />
						</div>
						<div class="form-group">
							<label for="status">学生状态:</label> <select name="status"
								class="form-control">
								<option value="">所有</option>
								<option value="1"
									<c:if test="${studentStatus eq 1 }">selected</c:if>>在读</option>
								<option value="0"
									<c:if test="${studentStatus eq 0 }">selected</c:if>>未选班</option>
								<option value="4"
									<c:if test="${studentStatus eq 4 }">selected</c:if>>毕业</option>
								<option value="5"
									<c:if test="${studentStatus eq 5 }">selected</c:if>>休学</option>
								<option value="6"
									<c:if test="${studentStatus eq 6 }">selected</c:if>>退学</option>
							</select>
						</div>
						<div class="form-group">
							<label for="classes.name">班级：</label> <select name="classes.name"
								class="form-control">
								<option value="">所有</option>
								<c:forEach items="${classes }" var="item">
									<option value="${item.name }"
										<c:if test="${classValue == item.name }">selected="selected"</c:if>>${item.name }</option>
								</c:forEach>
							</select>
						</div>
						<div class="form-group">
							<label for="classes.product.id">产品：</label> <select
								name="classes.product.id" class="form-control">
								<option value="">所有</option>
								<c:forEach items="${products }" var="item">
									<option value="${item.id }"
										<c:if test="${productValue == item.id }">selected="selected"</c:if>>${item.name }</option>
								</c:forEach>
							</select>
						</div>
						<input type="hidden" id="pageNum" name="pageNum" />
						<div class="form-group">
							<button type="submit" class="btn btn-default">搜索</button>
						</div>
						<div class="form-group">
							<button type="button" data-type="export" class="btn btn-default">
								<span class="glyphicon glyphicon-save">导出</span>
							</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="col-md-12">
			<table class="table table-hover table-border student-table">
				<thead>
					<tr>
						<th style="min-width: 8rem">学号</th>
						<th style="min-width: 7.2rem">姓名</th>
						<th style="min-width: 10rem">班级</th>
						<th style="min-width: 3em;">学历</th>
						<th style="min-width: 11rem">手机号码</th>
						<th style="min-width: 6rem">状态</th>
						<th>异常情况</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(pageInfo.list) == 0 }">
						<tr align="center">
							<td colspan="14">没有查询到数据</td>
						</tr>
					</c:if>
					<c:forEach items="${pageInfo.list }" var="item">
						<tr>
							<td><a href="student/info?id=${item.id }" data-title="学员详情">${item.id }</a></td>
							<td>${item.name }</td>
							<td>${item.classes.name }</td>
							<td>${item.education.name }</td>
							<td>${item.tel }</td>
							<td><c:choose>
									<c:when test="${item.status eq 0 }">未选班</c:when>
									<c:when test="${item.status eq 4 }">毕业</c:when>
									<c:when test="${item.status eq 5 }">休学</c:when>
									<c:when test="${item.status eq 6 }">退学</c:when>
									<c:otherwise>在读</c:otherwise>
								</c:choose></td>
							<td title="${item.abnormal }">
								<div class="hide-content" style="width: 14em;">
									<span>${item.abnormal }</span>
								</div>
							</td>
							<td><a
								href="student/edit?id=${item.id }&studentId=${studentId}&nameValue=${nameValue}&studentStatus=${studentStatus}&classValue=${classValue}&productValue=${productValue}&pageNum=${pageInfo.pageNum }&pageSize=${pageInfo.pageSize }"
								data-title="编辑学员" type="button" class="btn btn-primary btn-sm">
									<span class="glyphicon glyphicon-pencil"> 编辑</span>
							</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<c:import url="/WEB-INF/jsp/paging.jsp" />
		</div>
	</div>
</body>
</html>